---@class RiichiMahjong.TileManager : Object
local TileManager = class("RiichiMahjong.TileManager")
local Tile = require "packages.mahjong.riichi_mahjong.core.tile"

---@class RiichiMahjong.TileManager
---@field public all_tiles table<integer, RiichiMahjong.Tile>

function TileManager:initManager()
  self.all_tiles = {}
end

local cardId = 0

---@param suit string @ 花色
---@param number integer @ 数字
function TileManager:CreateTile(suit, number)
  local tile = Tile:new(suit, number, cardId)
  cardId = cardId + 1
  table.insert(self.all_tiles, tile)
  return tile
end

function TileManager:getTileById(cardId)
  return self.all_tiles[cardId]
end

return TileManager